﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;
namespace Xwork.SEO.WebSite.Models
{
    public class RegModel
    {
        [Required(ErrorMessage="请输入电子邮箱")]
        [RegularExpression("\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*",ErrorMessage="不是有效的电子邮箱地址")]
        [Remote("checkusername","account",ErrorMessage="用户名已存在")]
        [MaxLength(30)]
        public string Email { get; set; }

        [Required(ErrorMessage = "请输入密码")]
        [MinLength(6)]
        [MaxLength(12)]
        public string Password { get; set; }

        [Compare("Password",ErrorMessage="两次密码不相同")]
        [MinLength(6,ErrorMessage="密码最少6位")]
        [MaxLength(12)]
        public string Password2 { get; set; }

        [Required(ErrorMessage = "请输入验证码")]
        [Remote("checkvcode", "account", ErrorMessage = "验证码不正确")]
        public string Vcode { get; set; }
    }
}